﻿using System.Windows;
using System.Windows.Input;

namespace FFmpegVideoClip.windows
{
    /// <summary>
    /// CutSplitFileMessageWindow.xaml 的交互逻辑
    /// </summary>
    public partial class CutSplitFileMessageWindow : Window
    {
        public enum MessageResultEnum { CurrentClip, NewClip, SingleClips, Cancel }

        public static MessageResultEnum ShowMessage()
        {
            CutSplitFileMessageWindow window = new();
            window.Owner = Application.Current.MainWindow;
            if (window.ShowDialog() ?? false)
                return window.MessageResult;
            else return MessageResultEnum.Cancel;
        }

        public CutSplitFileMessageWindow() { InitializeComponent(); CancelButton.Focus(); Keyboard.Focus(CancelButton); }

        public MessageResultEnum MessageResult { get; private set; } = MessageResultEnum.Cancel;

        private void CurrentClipButton_Click(object sender, RoutedEventArgs e)
        {
            MessageResult = MessageResultEnum.CurrentClip;
            DialogResult = true;
        }

        private void NewClipButton_Click(object sender, RoutedEventArgs e)
        {
            MessageResult = MessageResultEnum.NewClip;
            DialogResult = true;
        }

        private void SingleClipsButton_Click(object sender, RoutedEventArgs e)
        {
            MessageResult = MessageResultEnum.SingleClips;
            DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            MessageResult = MessageResultEnum.Cancel;
            DialogResult = false;
        }
    }
}
